<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
// 1.将A5F3转成2进制
var huhu ='A5F3';
var gugu =parseInt(huhu,16)
var huahua=gugu.toString(2)
console.log(huahua);

// 2.99乘法表
var guagua='';
for(let i=1;i<10;i++){
       
    for(let a=1;a<=i;a++){
        guagua+=i+'*'+a+'='+a*i+'&nbsp&nbsp&nbsp&nbsp';
    }
    guagua+='<br>';

}
document.write(guagua);



// 3.输入年月，（用数组）
var huahua = prompt('输入年月日')
//       3.1.计算当月有多少天
var arr = huahua.split('.');
var year=arr[0];
var month=arr[1];
var day=arr[2];
var themonth=30;
if(month!=2){
    switch (month){
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            themonth=31;
            break;
        default:
            break;
    }
}else{        
if(year%400==0){
    themonth=29
}else if(year%4==0 && year%100!=0){
    themonth=29
}else{
    themonth=28
}
}      
document.write('当月还剩'+(themonth-day)+'天'+'<br>');
//       3.2.计算还剩多少天
var Feb=28;
var theyear=365;
if(year%400==0){
    Feb=29;
    theyear=366;
}else if(year%4==0 && year%100!=0){
    Feb=29;
    theyear=366;
}
var arry=new Array();
arry[1]=arry[3]=arry[5]=arry[7]=arry[8]=arry[10]=arry[12]=31;
arry[2]=Feb;
arry[4]=arry[6]=arry[9]=arry[11]=30;
var sum=0;
for(let i=1;i<month;i++){
    sum+=arry[i];
}
sum+=Number(day);
document.write('本年还剩'+(theyear-sum)+'天')
    </script>
</body>
</html>